package com.lxp.ssh2.web.action.users;

import java.util.List;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.ParentPackage;
import org.apache.struts2.convention.annotation.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

import com.lxp.ssh2.po.User;
import com.lxp.ssh2.service.UserService;
import com.opensymphony.xwork2.ActionSupport;

@Controller
@ParentPackage(value = "ssh2-default")
public class UserAction extends ActionSupport {
	
	@Autowired
	private UserService userService;
	
	private List<User> users;

	public List<User> getUsers() {
		return users;
	}
	
	@Action(value="list")
	public String list() {
		users = userService.find(null);
		return SUCCESS;
	}
	
}
